from easydict import EasyDict as edict

__C = edict()  # 创建一个edict
cfg = __C
__C.gpu_id = 0
__C.num_workers = 4

__C.train = edict()  # 再次使用edict，使得cfg.train.a = b
__C.train.restore = False
__C.train.lr = 0.0001
__C.train = dict(__C.train)

print("cfg=", cfg, "type(cfg)=", type(cfg))
print("cfg.train=", cfg.train, "type(cfg.train)=", type(cfg.train))

print("cfg.gpu_id=", cfg.gpu_id)
print("cfg.train.restore=", cfg.train.restore)
